<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/vue.js"></script>
</head>
<body>
<!--vue中的事件、方法定义         v-on 可以使用@ 符号来简写-->
<div id="myApp">
    <h1 v-text="msg"></h1>
    <button @click="changeVal">点我</button>
</div>

</body>
<script>
    new Vue({
        el: '#myApp',
        data: {
            msg: "哈哈哈"
        }, methods: {
            changeVal: function () {
                if (this.msg != "呵呵呵") {
                    this.msg = "呵呵呵"
                } else {
                    this.msg = "哈哈哈"
                }
            }
        }
    })
</script>
</html>